﻿using System.Web.Mvc;
using Cricket.Controllers;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Cricket.UnitTests.Requirements
{
    [TestClass]
    public class ApplicationControllerRequirements
    {
        ApplicationController controller;

        [TestInitialize]
        public void Setup()
        {
            //Controller
            controller = new ApplicationController();
        }

        #region Index GET

        [TestMethod]
        public void index_action_should_return_a_viewresult()
        {
            //Arrange.

            //Act.
            ViewResult result = (ViewResult)controller.Index();

            //Assert.
            Assert.IsNotNull(result, "result is null");
        }

        [TestMethod]
        public void index_action_should_return_the_index_view()
        {
            //Arrange.

            //Act.
            ViewResult result = (ViewResult)controller.Index();

            //Assert.
            Assert.AreEqual("Index", result.ViewName, "result.ViewName");
        }

        #endregion
    }
}